


import grails.test.*

class UserTests extends GrailsUnitTestCase {
	protected void setUp() {
		super.setUp()
		mockForConstraintsTests User
	}
	
	protected void tearDown() {
		super.tearDown()
	}
	
	void testUserNameShouldNotBeEmpty() {		
		def user = new User(username:'')
		assertTrue('User must have username', !user.validate())
	}
	
	void testUserRealNameShouldNotBeEmpty(){
		def user = new User(userRealName:'')
		assertTrue 'User must have Real Name', !user.validate()
	}
	
	void testUserPasswordShouldNotBeEmpty(){
		def user = new User(passwd:'')
		assertTrue 'User must have Password', !user.validate()
	}
	
	void testUserEmailShouldNotBeEmpty(){
		def user = new User(email:'')
		assertTrue 'User must have Email Address', !user.validate()
	}
}
